import QtQuick 2.6
import QtQuick.Layouts 1.2

import "../Base/UiBase"
import "../Base/Config"

ColumnLayout {
    id: root

    property string activeButtonName:"news"

    spacing: 0

    // title
    Rectangle {
        color: Color.main
        Layout.fillWidth: true
        height: 96 * Size.ratio
        Text {
            anchors.centerIn: parent
            text: "发现"
            font.pixelSize: Size.titleFont
            color: Color.foreground
        }
        BottomDivider{}
    }

    // nav
    Rectangle {
        Layout.fillWidth: true
        height: 96 * Size.ratio
        color: Color.foreground

        SvgzImage {
            width: 300 * Size.ratio
            height: 65 * Size.ratio
            anchors.centerIn: parent
            source: activeButtonName === "news" ? "../../resources/discover/zixungongneng01.svg" : "../../resources/discover/zixungongneng02.svg"
            MouseArea {
                width: parent.width/2
                height: parent.height
                onClicked: activeButtonName = "news"
            }
            MouseArea {
                x: parent.width/2
                width: parent.width/2
                height: parent.height
                onClicked: activeButtonName = "functional"
            }
        }

        BottomDivider{}
    } // end nav
}
